---
layout: default
---
<div class="row">
  <div class="col-md-9">
    {% for post in paginator.posts %}
      <div class="panel">
        <div class="panel-body">
          <h2><a href="{{ post.url | prepend: site.baseurl }}" class="title">{{ post.title }}</a></h2>
          <small>
            <span class="item">
              <i class="fa fa-calendar-check-o"></i> {{post.date | date: '%F'}}
            </span>&nbsp;
            {% if post.author %}
              <span class="item" style="display: none;">
                <i class="fa fa-user"></i> {{post.author}}
              </span>
            {% endif %}
            {% if post.categories %}
              {% include categories.html %}&nbsp;
            {% endif %}
            {% if post.tags %}
              {% include tags.html %}&nbsp;
            {% endif %}
          </small>
          <hr>
          <div class="excerpt">{{ post.excerpt }}</div>
          <div class="text-center" style="display: none;">
            <a href="{{ post.url | prepend: site.baseurl }}" class="btn btn-default read-more" style="color: #2288bb;">阅读更多</a>
          </div>
        {% if forloop.last %}
		
		<hr>
        <div class="paginate" style="display: flex; justify-content: space-between;">
		  <div style="flex: 1"  class="text-left">
              {% if paginator.previous_page %}
                <a href="{{ paginator.previous_page_path }}">较新的博客</a>
              {% endif %}
          </div>
          <div style="flex: 1" class="text-center">{{ paginator.page }} / {{ paginator.total_pages }}</div>
          <div style="flex: 1;" class="text-right">
              {% if paginator.next_page %}
                <a href="{{ paginator.next_page_path }}">较旧的博客</a>
              {% endif %}
          </div>
	    </div>
		
        <!--<div class="text-center paginate">
          <ul class="pagination">
          {% if paginator.previous_page %}
            <li class="prev">
              <a href="{{ paginator.previous_page_path }}"><i class="fa fa-chevron-left"></i></a>
            </li>
          {% else %}
            <li class="prev disabled">
              <a href="javascript:;"><i class="fa fa-chevron-left"></i></a>
            </li>
          {% endif %}
          <li><a href="javascript:;">{{ paginator.page }} / {{ paginator.total_pages }}</a></li>
          {% if paginator.next_page %}
            <li class="next">
              <a href="{{ paginator.next_page_path }}"><i class="fa fa-chevron-right"></a>
            </i>
          {% else %}
            <li class="next disabled">
              <a href="javascript:;"><i class="fa fa-chevron-right"></a>
            </i>
          {% endif %}
          </ul>
        </div>-->

        <!-- <div class="text-center paginate">
          {% if paginator.previous_page %}
            <a href="/"><i class="fa fa-angle-double-left">&nbsp;</i>&nbsp;</a>
            <a href="{{ paginator.previous_page_path }}">&nbsp;<i class="fa fa-angle-left"></i>&nbsp;</a>
          {% else %}
            <span class="disable">&nbsp;<i class="fa fa-angle-double-left">&nbsp;</i></span>
            <span class="disable">&nbsp;<i class="fa fa-angle-left"></i>&nbsp;</span>
          {% endif %}
          &nbsp;<span>{{ paginator.page }} / {{ paginator.total_pages }}&nbsp;</span>
          {% if paginator.next_page %}
            <a href="{{ paginator.next_page_path }}">&nbsp;<i class="fa fa-angle-right"></i>&nbsp;</a>
            <a href="/page{{ paginator.total_pages }}">&nbsp;<i class="fa fa-angle-double-right"></i>&nbsp;</a>
          {% else %}
            <span class="disable">&nbsp;<i class="fa fa-angle-right"></i>&nbsp;</span>
            <span class="disable">&nbsp;<i class="fa fa-angle-double-right"></i>&nbsp;</span>
          {% endif %}
        </div> -->


        {% endif %}
      </div>
    </div>
    {% endfor %}
  </div>
  <div class="col-md-3 hidden-sm hidden-xs">
    <div class="panel panel-default">
      <div class="panel-heading"><i class="fa fa-search"></i> 搜索</div>
      {% include sidebar-search.html %}
    </div>
    <div class="panel panel-default">
      <div class="panel-heading"><i class="fa fa-pencil-square-o"></i> 最近博客</div>
      <table class="table" style="table-layout: fixed;">
        {% for post in site.posts offset: 0 limit: 10 %}
          <tr>
            <td><a href="{{ post.url | prepend: site.baseurl }}">{{post.title}}</a></td>
          </tr>
        {% endfor %}
      </table>
    </div>
    <div class="panel panel-default">
      <div class="panel-heading"><i class="fa fa-th-list"></i> 博客分类</div>
      <table class="table">
        {% for category in site.categories %}
        <tr>
          <td>
            <a href="/category/#{{category | first}}">
              {{category | first}}
              <span class="badge">{{category | last | size}}</span>
            </a>
          </td>
        </tr>
        {% endfor %}
      </table>
    </div>
    <div class="panel panel-default">
      <div class="panel-heading"><i class="fa fa-tags"></i> 博客标签</div>
      <div class="panel-body tags">
        {% assign first = site.tags.first %}
        {% assign max = first[1].size %}
        {% assign min = max %}
        {% for tag in site.tags offset:1 %}
          {% if tag[0].size > max %}
            {% assign max = tag[0].size %}
          {% elsif tag[0].size < min %}
            {% assign min = tag[0].size %}
          {% endif %}
        {% endfor %}
        {% assign diff = max | minus: min %}
        {% for tag in site.tags %}
          {% assign temp = tag[1].size | minus: min | times: 36 | divided_by: diff %}
          {% assign base = temp | divided_by: 4 %}
          {% assign remain = temp | modulo: 4 %}
          {% if remain == 0 %}
            {% assign size = base | plus: 10 %}
          {% elsif remain == 1 or remain == 2 %}
            {% assign size = base | plus: 10 | append: '.5' %}
          {% else %}
            {% assign size = base | plus: 11 %}
          {% endif %}
          {% if remain == 0 or remain == 1 %}
            {% assign color = 9 | minus: base %}
          {% else %}
            {% assign color = 8 | minus: base %}
          {% endif %}
          <a href="/tag/#{{ tag | first | slugify }}" style="font-size: {{ size }}pt;">{{ tag[0] }}</a>
        {% endfor %}
      </div>
    </div>
  </div>
</div>
